﻿
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Ease Template Manual - SYSTN.COM</title>
<style>
<!--

td { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px; color:#000000   }
.style8 {
background-color: #FFFFFF;
}

p { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px; color:#000000   }
.style10 {
font-size: 9px;
font-family: "Arial Unicode MS";
text-align: right;
}
-->
</style>
</head>

<table class="style4" style="WIDTH: 100%" cellSpacing="0" cellPadding="0" border="0" id="table1">
	<tr>
		<td class="style8">
		<table style="WIDTH: 100%" cellSpacing="8" cellPadding="8" border="0" id="table2">
			<tr>
				<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
				<table id="table3" style="BORDER-COLLAPSE: collapse" borderColor="#808080" cellPadding="4" width="100%" align="left" border="0">
					<tr>
						<td vAlign="top" colSpan="2" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
						<font style="FONT-SIZE: 30px" color="#94a7b1">
						<font face="Arial">Ease Template Manual</font> </font>
						<font style="FONT-SIZE: 10px" face="Arial" color="#94a7b1">
						Version:E3</font></td>
					</tr>
					<tr>
						<td vAlign="top" width="4" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">　</td>
						<td vAlign="top" align="left" width="98%" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
						<table class="TableBorder" cellSpacing="1" cellPadding="0" width="100%" border="0" id="table5">
							<tr>
								<td class="TableMiddle">Ease Template 
								有两种另类循环处理方式。所谓另类就是可以对循环的表格进行换行或是换颜色。在以往的开发中，这些都比较麻烦，但在使用另类循环后由页面工程师就可以完成工作。<br>
								<br>
								首先介绍表格换行用法。这里不单指换行，而且用户可以根据需求在换行的表格中设置颜色，方便用户实现特殊需求。<br>
								<br>
　<table style="BORDER-COLLAPSE: collapse" cellSpacing="1" width="100%" bgColor="#e1e7f0" border="0" id="table6">
									<tr>
										<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
										使用说明:</td>
									</tr>
									<tr>
										<td bgColor="#ffffff" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
										<table style="BORDER-COLLAPSE: collapse" cellSpacing="2" cellPadding="2" width="100%" border="0" id="table7">
											<tr>
												<td bgColor="#ffffff" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
												用法：<font color="#007700">{row:2}</font><br>
												语句解释：{row:2,换行内容}<br>
												2表示每行显示2个，如果设置了独立的换行内容可以设置每行的颜色。<br>
												例如:<font color="#007700">{row:2,#ffffff:#dcdcdc}<br>
												</font><br>
												另外的使用方法：<br>
												<font color="#007700">&lt;!-- row:2 
												--&gt;</font><br>
												或者<br>
												<font color="#007700">&lt;!-- 
												row:2,#ffffff:#dcdcdc --&gt;</font></td>
											</tr>
										</table>
										</td>
									</tr>
								</table>
								<br>
								test_7.php<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">
									<span style="COLOR: #0000bb">&lt;?php &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #007700">include</span><span style="COLOR: #dd0000">&quot;./template.ease.php&quot;</span><span style="COLOR: #007700">; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl&nbsp;</span><span style="COLOR: #007700">=&nbsp;new&nbsp;</span><span style="COLOR: #0000bb">template</span><span style="COLOR: #007700">(); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$lists&nbsp;</span><span style="COLOR: #007700">=&nbsp;array(</span><span style="COLOR: #dd0000">'香蕉'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'茄子'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'白菜'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'龙虾'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'老虎'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'猎人'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'飞机'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'宇宙'</span><span style="COLOR: #007700">); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl</span><span style="COLOR: #007700">-&gt;</span><span style="COLOR: #0000bb">set_file</span><span style="COLOR: #007700">(</span><span style="COLOR: #dd0000">'test_7'</span><span style="COLOR: #007700">); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl</span><span style="COLOR: #007700">-&gt;</span><span style="COLOR: #0000bb">p</span><span style="COLOR: #007700">(); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">?&gt;</span>
									</span></code></li>
								</ol>
								<br>
								test_7.htm<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">普通换行&lt;br&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;table&nbsp;border=&quot;1&quot;&nbsp;width=&quot;100%&quot;&nbsp;bordercolor=&quot;#808080&quot;&nbsp;style=&quot;border-collapse:&nbsp;collapse&quot;&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;$lists&nbsp;AS&nbsp;$k=&gt;$v&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<font color="#007700">{v}</font>&lt;/td&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#007700">{Row:2}</font>&nbsp;<font color="#808080">&lt;!--&nbsp;设置换行数量,2表示一行显示两个单元格&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;END&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;/table&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;br&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									换行改变颜色&lt;br&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;table&nbsp;border=&quot;1&quot;&nbsp;width=&quot;100%&quot;&nbsp;bordercolor=&quot;#808080&quot;&nbsp;style=&quot;border-collapse:&nbsp;collapse&quot;&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;$lists&nbsp;AS&nbsp;$k=&gt;$v&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;<font color="#007700">{v}</font>&lt;/td&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;ROW:2,#ffffff:#dcdcdc&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;END&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;/table&gt;</span> </code></li>
								</ol>
								<br>
								<br>
								看到这里也许你会问：既然表格能换颜色了，为什么还要讲解换颜色的问题？<br>
								主要目的是想让你知道如何做到更另类的颜色更换效果，并且配合上面换行实现颜色变换。<br>
								<br>
								test_8.php<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">
									<span style="COLOR: #0000bb">&lt;?php &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #007700">include</span><span style="COLOR: #dd0000">&quot;./template.ease.php&quot;</span><span style="COLOR: #007700">; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl&nbsp;</span><span style="COLOR: #007700">=&nbsp;new&nbsp;</span><span style="COLOR: #0000bb">template</span><span style="COLOR: #007700">(); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$lists&nbsp;</span><span style="COLOR: #007700">=&nbsp;array(</span><span style="COLOR: #dd0000">'香蕉'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'茄子'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'白菜'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'龙虾'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'老虎'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'猎人'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'飞机'</span><span style="COLOR: #007700">,</span><span style="COLOR: #dd0000">'宇宙'</span><span style="COLOR: #007700">); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl</span><span style="COLOR: #007700">-&gt;</span><span style="COLOR: #0000bb">set_file</span><span style="COLOR: #007700">(</span><span style="COLOR: #dd0000">'test_8'</span><span style="COLOR: #007700">); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">$tpl</span><span style="COLOR: #007700">-&gt;</span><span style="COLOR: #0000bb">p</span><span style="COLOR: #007700">(); 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									</span><span style="COLOR: #0000bb">?&gt;</span>
									</span></code></li>
								</ol>
								<br>
								<br>
								下面的模板介绍了两种效果。<br>
								<br>
								test_8.htm<br>
　<ol style="text-align: left; margin: 0px; padding-left: 40px; padding-right: 1px; padding-top: 1px; padding-bottom: 1px; background: #e1e7f0">
									<li style="background: #ffffff url('images/code_bg.gif')">
									<code><span style="COLOR: #000000">隔行更换颜色&lt;br&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;table&nbsp;border=&quot;1&quot;&nbsp;width=&quot;100%&quot;&nbsp;bordercolor=&quot;#808080&quot;&nbsp;style=&quot;border-collapse:&nbsp;collapse&quot;&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;<font color="#808080">&lt;!--&nbsp;$lists&nbsp;AS&nbsp;$k=&gt;$v&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&lt;tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&lt;td&nbsp;bgcolor=&quot;<font color="#007700">{color:#dcdcdc,#ffffff}</font>&quot;&gt;<font color="#007700">{_i}</font>.<font color="#007700">{v}</font>&lt;/td&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&lt;/tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;<font color="#808080">&lt;!--&nbsp;END&nbsp;--&gt;</font> &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;/table&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;br&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									结合表格换行并且更改颜色&lt;br&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;table&nbsp;border=&quot;1&quot;&nbsp;width=&quot;100%&quot;&nbsp;bordercolor=&quot;#808080&quot;&nbsp;style=&quot;border-collapse:&nbsp;collapse&quot;&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;$lists&nbsp;AS&nbsp;$k=&gt;$v&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&nbsp;bgcolor='<font color="#007700">{color:#FFE1FF,#BBDDFF}</font>'&gt;<font color="#007700">{_i}</font>.<font color="#007700">{v}</font>&lt;/td&gt; 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;row:2&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;<font color="#808080">&lt;!--&nbsp;END&nbsp;--&gt;</font> 
									&nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt; &nbsp;
									</li>
									<li style="background: #ffffff url('images/code_bg.gif')">
									&lt;/table&gt;</span> </code></li>
								</ol>
								<br>
								<br>
								说到这里循环的功能基本上就讲完了，后面我们将讲解开发debug及优化效率方式。</td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="style8" style="HEIGHT: 21px">
		<table class="style4" cellSpacing="0" cellPadding="0" align="right" id="table8">
			<tr>
				<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
				<img height="13" src="images/copyright_left.gif" width="3"></td>
				<td class="style10" style="WIDTH: 240px" background="images/copyright_bg.gif">
				Copyright 2005 - 2008 <a href="http://www.systn.com" target="_blank"><font color="#000000">SYSTN.COM</font></a>&nbsp;&nbsp;&nbsp;</td>
				<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000">
				<img height="13" src="images/copyright_right.gif" width="2"></td>
			</tr>
		</table>
		</td>
	</tr>
</table>
